<%@ page language="java"import="java.util.*,com.bjsxt.shopping.user.*,com.bjsxt.shopping.product.*,com.bjsxt.shopping.util.Util"  pageEncoding="utf-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/"; 
%>

<%
	User u = (User)session.getAttribute("user");
	
	//判断会话过期处理
	if(Util.ifSessionExpire(u)){
		response.sendRedirect("UserLoginMobile.jsp");
		return;
	}
	
	String consumerid = u.getLoginname();

	final int PAGE_SIZE = 8;
	int pageNo = 1;
	String strPageNo = request.getParameter("pageNo");
	if (strPageNo != null && !strPageNo.trim().equals("")) {
		try {
	pageNo = Integer.parseInt(strPageNo);
		} catch (NumberFormatException e) {
	pageNo = 1;
		}
	}
	if (pageNo <= 0)
		pageNo = 1;
	// int categoryId = Integer.parseInt(request.getParameter("categoryId"));
	
	int categoryId =1;
	
	List<Product> products = new ArrayList<Product>();
	int totalRecords = ProductMgr.getInstance().findWebpage(products, pageNo,
	PAGE_SIZE, categoryId);

	int totalPages = (totalRecords + PAGE_SIZE - 1) / PAGE_SIZE;

	if (pageNo > totalPages)
		pageNo = totalPages;
%>
 <!DOCTYPE html>
<html>
    <head>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>译者抢单</title>
        <link rel="stylesheet" href="<%=basePath%>Plug/jquery.mobile-1.2.0/jquery.mobile-1.2.0.min.css" />
        <link rel="stylesheet" href="<%=basePath%>Plug/jquery.mobile-1.2.0/demos/docs/_assets/css/jqm-docs.css" />
        <script src="<%=basePath%>Plug/jquery.mobile-1.2.0/jquery-1.8.3.min.js">
        </script>
        <script src="<%=basePath%>Plug/jquery.mobile-1.2.0/jquery.mobile-1.2.0.min.js">
        </script>
        <script src="<%=basePath%>Plug/chart/ichart-1.0.min.js">
        </script>
        <script src="<%=basePath%>Plug/message.js">
        </script>
        <link rel="stylesheet" href="<%=basePath%>css/TobaccoMobileView.css" />
  
    </head>
    <body>
        <div data-role="page" class="type-interior" id="januarySales">
            <div data-role="header" data-theme="f">
                <h1>翻译抢单</h1>
                <a rel="external"  href="" data-icon="home" data-iconpos="notext">Home</a>
                <a rel="external"  href="<%=basePath%>UserLoginMobile.jsp" data-value="退出" >退出</a>
            </div>
            <!-- /header -->
            <!-- /navbar -->
            <div data-role="content">
                ${month}你好<strong>${brandName}</strong><span id="monthTotal"></span>，订单列表：
                
                <table style="width:100%" border="1">
                    <thead>
                        <tr class="first">
                            <td width="72">
                                文章编号
                            </td>
                            <td width="72">
                               类型
                            </td>
                            <td width="72">
                              文章标题
                            </td>
                            <td width="72">
                                字数
                            </td>
                           <td width="72">
                               价格
                            </td>
                            <td width="72">
                              发布时间
                            </td>
                            <td width="72">
                              难度
                            </td>
                            <td width="72">
                              紧迫度
                            </td>
                            <td width="72">
                             
                            </td>
                             <td width="72">
                               
                            </td>
                        </tr>
                    </thead>
                    
			<% for (int i = 0; i < products.size(); i++) {
				Product p = products.get(i);
			%>                    
		                        <tr class="first">
		                            <td width="72">
		                                <%=p.getId()%>
		                            </td>
		                            <td width="72">
		                           		俄翻中 
		                            </td>
		                            <td width="72">
		                                <%=p.getSubject()%>  
		                            </td>
		                            <td width="72">
		                               	共348字
		                            </td>
		                             <td width="72">
		                             	￥146   
		                            </td>
		                            <td width="72">
                                    2015-03-19 10:24:12   
                                    </td>
                                    <td width="72">
                             			中
                                    </td>
                                    <td width="72">
                          				急
                                    </td>
                                    <td width="72">
                             		 <a href="mobileQiangDanDetail.jsp"><u>详细</u></a>
                                    </td>
		                            <td width="72">
		                             	<img src="/images/qiangD.gif"></img> 
		                            </td>
		                        </tr>
                     		<%
							} // end for
							%>
                </table>
            </div>
            
			<!-- /content -->
            <div data-role="footer" class="footer-docs" data-theme="c">
                <p class="jqm-version">
                </p>
                <p>
                    &copy; 2015 众译快翻平台
                </p>
            </div>
        </div>
    </body>
</html>
